package com.apes.autoparts.matchingRule;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MatchingRuleService extends DomainService {

    @Autowired
    VoluntaryOffersDao voluntaryOffersDao;

    /**
     *从数据中心获取查询接口测试
     * @param request
     */
    public  JSONArray findByPZCXID(SimpleRequest request){
         JSONObject ject = request.getJO();
        return voluntaryOffersDao.findByPZCXID(ject);

    }

    /**
     *匹配规则匹配商品
     * @param request
     */
    public  JSONArray findByPPGZ(SimpleRequest request){
        JSONObject ject = request.getJO();
        return voluntaryOffersDao.findByPPGZ(ject);

    }


    /**
     * 获取电子目录规则
     * @param request
     * @return
     */
    public List<Map> findByCXDZML(SimpleRequest request) {
        JSONObject ject = request.getJO();
        return voluntaryOffersDao.findByCXDZML(ject);
    }

    /**
     * 获取配件名称ID替换件
     * @param request
     * @return
     */
    public  JSONArray findMountingsIDReplace(SimpleRequest request) {
        JSONObject ject = request.getJO();
        return voluntaryOffersDao.findMountingsIDReplace(ject);
    }


}
